<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>hover切换特效</title>
    <style>
        body{
            margin: 0;
            padding: 0;
            background-color: #f1f1f1;
        }
        #btn{
            width: 200px;
            height: 60px;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background-color: #ffc107;
            cursor: pointer;
            border-radius: 5px;
            overflow: hidden;
        }
        #btn:before{
            color: white;
            width: 150px;
            text-align: center;
            font-size: 20px;
            font-family: sans-serif;
            content: 'HOVER ME';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            transition: all 0.5s;
        }
        #btn:hover:before{
            top: -30px;
        }
        #btn:after{
            color: white;
            font-size: 20px;
            font-family: sans-serif;
            content: 'BIU';
            position: absolute;
            top: 140%;
            left: 50%;
            transform: translate(-50%, -50%);
            transition: all 0.5s;
        }
        #btn:hover:after{
            top: 50%;
        }

    </style>
</head>
<body>
    <div id="btn"></div>
</body>
</html>